
public class HomeWork2 {
	public static void main(String[] args) {
		String string = "kkabkkcdkkefkkskk";
		String kk = "kk";
		int count = 0;
		int index = 0;
		while (string.indexOf("kk", index) >= 0) {
			int suoyin = string.indexOf("kk", index);
			index = suoyin + kk.length();
			count++;

		}
		System.out.println("kk出现次数为：	" + count + "次！");

	}
}